// Learn cc.Class:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html
//  - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
//  - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
//  - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: cc.Component,

    properties: {
        rowNode:{
            default:null,
            type:cc.Node,
        }
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        cc.gg = {}
        let GameController = require("GameController")
        cc.gg.gameCtl = new GameController()

        let HttpUtil = require("HttpUtil")
        cc.gg.httpUtil = new HttpUtil()

        //to restore game data
        let DataMgr = require("DataMgr")
        cc.gg.dataMgr = new DataMgr()

        let EnumConfig = require("EnumConfig")
        cc.gg.enumConfig = new EnumConfig()

        let BaseUtil = require("BaseUtil")
        cc.gg.baseUtil = new BaseUtil()

        let SortUtil = require("SortUtil")
        cc.gg.sortUtil = new SortUtil()

        let ToastMgr = require("ToastMgr")
        cc.gg.toastMgr = new ToastMgr()

        //For restoring of local game data
        let GameDataUtil = require("GameDataUtil")
        cc.gg.gameDataUtil = new GameDataUtil()

        //Util for functions innner of canvas
        let GameLogicUtil = require("GameLogicUtil")
        cc.gg.logicUtil = new GameLogicUtil()

        let ResourceUtil = require("ResourceUtil")
        cc.gg.resUtil = new ResourceUtil()

        cc.logcal = function (...vars) {
            if(true)
                cc.log(...vars)
        }

        cc.logfl = function (...vars) {
            if(!true)
                return
            cc.log("========flow:",...vars)
        }

        cc.logdrag = function (...vars) {
            if(true)
                cc.log("Log Drag:",...vars)
        }

        cc.logmsg = function (...vars) {
            if(true)
                cc.log(...vars)
        }

        cc.logbot = function (...vars) {
            if(true)
                cc.log(...vars)
        }

        cc.loggrab = function (...vars) {
            if(true)
                cc.log("grab:",...vars)
        }

        cc.logws = function (...vars) {
            if(true)
                cc.log("ws:",...vars)
        }
    },

    start () {
        // let botType = cc.gg.sortUtil.IS_SEQUENCE_ONLY_VALUE([0x2a,0x2b,0x2c,0x2d,0x21],0x0a)
        // cc.error(botType)
        let mixCard = 0x01
        let cards = [
            [0x11,0x2c,0x2d],
            [0x2b,0x2c,0x31],
            [0x08,0x0a],
            [0x36,0x37],
            [0x33]
        ]

        let a = cc.gg.sortUtil.IS_SEQUENCE_ONLY_VALUE([0x11,0x2c,0x2d],1)
        cc.log("noMix1:",a)
        let b = cc.gg.sortUtil.IS_SEQUENCE_ONLY_VALUE([0x2b,0x2c,0x31],1)
        cc.log("noMix2:",b)
        this.rowNode.getComponent("deal_info_row").refreshCards(cards,null,mixCard)
    },

    // update (dt) {},
});
